package org.upida.validation;

public class ValidationException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	private IFailureList failures;
	private Class<?> typeValidatorType;
	private Class<?> group;

	public ValidationException(IFailureList errors)
	{
		this.failures = errors;
	}
	
	public ValidationException(IFailureList errors, Class<?> typeValidatorType, Class<?> group) {
		this.failures = errors;
		this.typeValidatorType = typeValidatorType;
		this.group = group;
	}

	public FailResponse buildFailResponse() {
		FailResponse response = new FailResponse();
		response.setFailures(this.failures);
		return response;
	}

	public IFailureList getFailures() {
		return this.failures;
	}

	public Class<?> getTypeValidatorType() {
		return this.typeValidatorType;
	}

	public Class<?> getGroup() {
		return this.group;
	}
}